package com.example.rentalclearing.common;

import java.math.BigDecimal;

public class ThreadLocalClearingResult {
    private int totalRecords = 0;
    private BigDecimal totalPrincipal = BigDecimal.ZERO;
    private BigDecimal totalInterest = BigDecimal.ZERO;

    // getters and setters
    public int getTotalRecords() { return totalRecords; }
    public void setTotalRecords(int totalRecords) { this.totalRecords = totalRecords; }
    public BigDecimal getTotalPrincipal() { return totalPrincipal; }
    public void setTotalPrincipal(BigDecimal totalPrincipal) { this.totalPrincipal = totalPrincipal; }
    public BigDecimal getTotalInterest() { return totalInterest; }
    public void setTotalInterest(BigDecimal totalInterest) { this.totalInterest = totalInterest; }

    // 增加方法而不是直接设置
    public void addTotalRecords(int count) { this.totalRecords += count; }
    public void addTotalPrincipal(BigDecimal amount) { this.totalPrincipal = this.totalPrincipal.add(amount); }
    public void addTotalInterest(BigDecimal amount) { this.totalInterest = this.totalInterest.add(amount); }
}
